chore(deps-dev): Migrate to vitest 4 and fix what it surfaced - #7
Merged
Conversation
This was referenced Sep 2, 2026
vitest and @vitest/coverage-v8 are peer-locked, so Dependabot's split PRs each failed npm ci on the other's half; this does both at once. vitest 4 remaps coverage from the AST, and that stricter accounting exposed three real problems behind the previously-green 100%: - src/engine/run.ts held a literal NUL byte where a space separator was intended. git and grep treated the file as binary and silently skipped it, which is also why an earlier refactor of that function never applied. The separator is now an explicit escape with a comment. - mergeAcrossDialects kept a duplicate-check branch no input can reach; a Set expresses the intent and drops the branch. - parse.ts guarded firstError.pos, which yaml declares required, so the optional chain and its guard were dead code. The genuinely optional node.range guard keeps its ignore hint, now in block form, which is what AST-aware remapping honors. The empty per-file coverage table under vitest 4 is the reporter hiding fully-covered files, not a disabled gate: verified by adding uncovered code and watching the thresholds fail with exit 1. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoMv1uCaJQPs44rFX5XWEm
korya
force-pushed
the
chore-vitest-4
branch
from
September 2, 2026 13:25
3d80f7c to
1107870
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #5 and #3, which cannot pass individually:
vitestand@vitest/coverage-v8are peer-locked, so each PR failsnpm cion the other half of the upgrade. This does both at once.vitest 4 remaps coverage from the AST, and that stricter accounting exposed three genuine problems hiding behind the previously-green 100%:
A literal NUL byte in
src/engine/run.ts, where a space separator was intended in the dedup key.join(...). git and grep treat the file as binary and silently skip it, which is also why an earlier refactor of that same function silently never applied. It is now an explicit unicode escape, with a comment on why that separator was chosen.A dead branch in
mergeAcrossDialects. The duplicate-dialect check could never be false. ASetexpresses the intent directly and removes the branch.Dead code in
parse.ts.YAMLError.posis declared required by theyamlpackage, so the optional chain and itsundefinedguard were unreachable; removed. The genuinely optionalnode.rangeguard keeps its ignore hint, moved to the block form that AST-aware remapping honors.On the empty coverage table
vitest 4 omits fully-covered files from the text table, printing only the summary. That looks alarmingly like a disabled gate, so I verified it rather than assuming: adding an uncovered function makes the file reappear in the table, the thresholds ERROR, and
npm testexits 1. Restoring it returns exit 0. The gate still bites.Full check green: 90 tests, 100% statements / branches / functions / lines, plus build and a CLI smoke run.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RoMv1uCaJQPs44rFX5XWEm